<?php

session_start();
if(!array_key_exists("user", $_SESSION) || $_SESSION['account'] != 2){
	header("Location: ../common/redirect.php");
	exit;
}

include_once("../class/db.php");
$db = new db();

$link = $_SESSION['link'];
$sql = "SELECT MAX(order_number) as order_number FROM course_modules WHERE link = '$link'";
$order_number = $db->execute($sql, "onerow");
if($order_number['order_number'] == NULL){
	$order_number['order_number'] = 1;
} else {
	$order_number['order_number']++;
}

if(array_key_exists("createcontent", $_POST)){
	$title = $_POST['title'];
	if($_POST['createcontent'] != "module" && $_POST['start_date'] != "" && $_POST['end_date'] != ""){
		$start_date1 = explode(" ", preg_replace("/[^a-zA-Z0-9_\-:\.\s]/", "", $_POST['start_date']));
		$end_date1 = explode(" ",  preg_replace("/[^a-zA-Z0-9_\-:\.\s]/", "", $_POST['end_date']));
		$start_date2 = explode("-", $start_date1[0]);
		$start_hour = explode(":", $start_date1[1]);
		$end_date2 = explode("-", $end_date1[0]);
		$end_hour = explode(":", $end_date1[1]);

		$start_date = date("Y-m-d H:i:s", mktime($start_hour[0], $start_hour[1], $start_hour[2], $start_date2[1], $start_date2[0], $start_date2[2]));
		$end_date = date("Y-m-d H:i:s", mktime($end_hour[0], $end_hour[1], $end_hour[2], $end_date2[1], $end_date2[0], $end_date2[2]));
		$sql = "INSERT INTO course_modules (owner, link, order_number, title, start_date, end_date) VALUES ({$_SESSION['user']}, '$link', {$order_number['order_number']}, '$title', '$start_date', '$end_date')";
		
	} else {
		
		$sql = "INSERT INTO course_modules (owner, link, order_number, title) VALUES ({$_SESSION['user']}, '$link', {$order_number['order_number']}, '$title')";
		
	}
	$db->execute($sql, "none");
	$sql = "SELECT MAX(id) as content_id FROM course_modules";
	$uid_results_check = $db->execute($sql, "onerow");
	$uid = $uid_results_check['content_id'];
	
}

if(array_key_exists("contenttype", $_POST)){
	$contenttype = preg_replace("/[^a-zA-Z0-9\-_\.\s]/", "", $_POST['contenttype']);
	$uid = $_POST['uid'];
	$sql = "SELECT MAX(order_number) as number FROM course_content WHERE uid = $uid and owner = {$_SESSION['user']}";
	$course_content_order_number = $db->execute($sql, "onerow");
	if($course_content_order_number['number'] == NULL){
		$course_order_number_new = 1;
	} else {
		$course_order_number_new = $course_content_order_number['number'] + 1;
	}
	
	switch($contenttype){
		case "power_point":
			$title = addslashes(preg_replace("/[^a-zA-Z0-9\.\'\"\s]/", "", $_POST['title']));
			$presentation = rand(1,999999).$_FILES['pp_presentation']['name'];
			$document_description = addslashes($_POST['document_description']);
			$file_tmp = $_FILES['pp_presentation']['tmp_name'];
			$file_ori = "../documents/course/".$presentation;
			move_uploaded_file($file_tmp, $file_ori);
			$sql = "INSERT INTO course_content (uid, owner, order_number, title, contenttype, document_path, document_description) VALUES ($uid, {$_SESSION['user']}, $course_order_number_new, '$title', '$contenttype', '$presentation', '$document_description')";
			break;
		case "video":
			$title = addslashes(preg_replace("/[^a-zA-Z0-9\.\'\"\s]/", "", $_POST['title']));
			$video_url = preg_replace("/[^a-zA-Z0-9\.:\-_\'\/\\\"\s]/", "", $_POST['video_url']);
			$video_description = addslashes($_POST['video_description']);
			$sql = "INSERT INTO course_content (uid, owner, order_number, title, contenttype, video_path, video_description) VALUES ({$_POST['uid']}, {$_SESSION['user']}, $course_order_number_new, '$title', '$contenttype', '$video_url', '$video_description')";
			break;
		case "rich-text":
			$title = addslashes(preg_replace("/[^a-zA-Z0-9\.\'\"\s]/", "", $_POST['title']));
			$content = addslashes($_POST['body_content']);
			$sql = "INSERT INTO course_content (uid, owner, order_number, title, contenttype, content) VALUES ({$_POST['uid']}, {$_SESSION['user']}, $course_order_number_new, '$title', '$contenttype', '$content')";
			break;
		case "homework":
			$title = addslashes(preg_replace("/[^a-zA-Z0-9\.\'\"\s]/", "", $_POST['title']));
			$content = addslashes($_POST['homework_content']);
			$deliver_method = $_POST['deliver_method'];
			$end_date1 = explode(" ",  preg_replace("/[^a-zA-Z0-9_\-:\.\s]/", "", $_POST['end_date']));
			$end_date2 = explode("-", $end_date1[0]);
			$end_hour = explode(":", $end_date1[1]);
			$end_date = date("Y-m-d H:i:s", mktime($end_hour[0], $end_hour[1], $end_hour[2], $end_date2[1], $end_date2[0], $end_date2[2]));
			
			$sql = "INSERT INTO course_content (uid, owner, order_number, title, contenttype, content, deliver_method, homework_end_date) VALUES ({$_POST['uid']}, {$_SESSION['user']}, $course_order_number_new, '$title', '$contenttype', '$content', '$deliver_method', '$end_date')";
			break;
		case "exam":
			$title = addslashes(preg_replace("/[^a-zA-Z0-9\.\'\"\s]/", "", $_POST['title']));
			$question_type = $_POST['question_type'];
			$question_quantity = $_POST['question_quantity'];
			$question_source = $_POST['question_source'];
			$question_display = $_POST['question_display'];
			$automatic_score = $_POST['automatic_score'];
			$question_timer = $_POST['question_timer'];
			$calculator = $_POST['calculator'];
			$start_date1 = explode(" ", preg_replace("/[^a-zA-Z0-9_\-:\.\s]/", "", $_POST['start_date']));
			$end_date1 = explode(" ",  preg_replace("/[^a-zA-Z0-9_\-:\.\s]/", "", $_POST['end_date']));
			$start_date2 = explode("-", $start_date1[0]);
			$start_hour = explode(":", $start_date1[1]);
			$end_date2 = explode("-", $end_date1[0]);
			$end_hour = explode(":", $end_date1[1]);
			$start_date = date("Y-m-d H:i:s", mktime($start_hour[0], $start_hour[1], $start_hour[2], $start_date2[1], $start_date2[0], $start_date2[2]));
			$end_date = date("Y-m-d H:i:s", mktime($end_hour[0], $end_hour[1], $end_hour[2], $end_date2[1], $end_date2[0], $end_date2[2]));
			
			$sql = "INSERT INTO course_content (uid, owner, order_number, title, contenttype, question_type, question_quantity, question_source, automatic_score, question_timer, question_display, calculator, start_date, end_date) VALUES ($uid, {$_SESSION['user']}, $course_order_number_new, '$title', '$contenttype', '$question_type', '$question_quantity', '$question_source', '$automatic_score', $question_timer, $question_display, '$calculator', '$start_date', '$end_date')";
			if(array_key_exists("returnto", $_POST)){
				$db->execute($sql, "none");
				header("Location: test.php?action=added");
				exit;
			}
			break;
	}
	$db->execute($sql, "none");
}

if(array_key_exists("uid", $_GET) || array_key_exists("uid", $_POST)){
	if(array_key_exists("uid", $_GET)){
		$uid = preg_replace("/[^a-zA-Z0-9\.\s]/", "", $_GET['uid']);
	} else {
		$uid = preg_replace("/[^a-zA-Z0-9\.\s]/", "", $_POST['uid']);
	}

	
	$sql = "SELECT id FROM course_modules WHERE owner = {$_SESSION['user']} AND id = $uid";
	$uid_exists = $db->execute($sql, "onerow");
	
	if($uid_exists == false){
		header("Location: class-create-content.php");
		exit;
	}
	
	$sql = "SELECT * FROM course_content WHERE uid = $uid";
	$course_content = $db->execute($sql, "all");
}

if(!isset($uid)){
	header("Location: class-create-content.php");
	exit;
}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>PIE EDUCATION | Educational Network</title>
<link rel="stylesheet" type="text/css" href="/css/style-student.css" />
<script type="text/javascript" src="/js/index.js"></script>
<script language="JavaScript" src="/js/ts_picker.js"></script>
<script type="text/javascript" src="/js/nicEdit.js"></script>
<link href="/css/jquery-ui.css" rel="stylesheet" type="text/css"/>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
<script language="Javascript1.2">
<!--
setTimeout('location.href="/logout.php?expire=1"',600000);
// -->
</script>
<script type="text/javascript">
$(document).ready(function(){ 
						   
	$(function() {
		$("#contentLeft ul").sortable({ opacity: 0.6, cursor: 'move', update: function() {
			var order = $(this).sortable("serialize") + '&action=updateRecordsListings';
			$.post("class-review-content-update.php", order, function(theResponse){
				//$("#contentRight").html(theResponse);
			}); 															 
		}								  
		});
	});
	
	$("#accordion").accordion({ autoHeight: false });

});	
</script>
<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-35230372-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>
</head>

<body>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td bgcolor="#000000"><table width="980" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td width="350" height="30">&nbsp;</td>
        <td align="right" valign="bottom"><a href="class.php" class="top-menu" style="color:#999">MY CLASS</a> <a href="schedule.php" class="top-menu" style="color:#999">CALENDAR</a> <a href="homework.php" class="top-menu" style="color:#999">HOMEWORK</a> <a href="test.php" class="top-menu" style="color:#999">EXAMS</a> <a href="grades.php" class="top-menu" style="color:#999">GRADES</a> <a href="tools.php" class="top-menu" style="color:#999">TOOLS</a> <a href="/logout.php" class="top-menu" style="color:#999">SIGN OUT</a></td>
      </tr>
	  <tr>
        <td>&nbsp;</td>
        <td align="right" valign="bottom"><a href="/profile/" class="login-menu" style="color:#FFF"><?php echo $_SESSION['name'].' '.$_SESSION['lname']; ?></a> <a href="/common/redirect.php" class="login-menu" style="color:#FFF">My Documents</a> <a href="/network/" class="login-menu" style="color:#FFF">My Wall</a> <a href="/common/settings.php" class="login-menu" style="color:#FFF">Settings</a></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="30" style="background-image:url(/images/top-bg-student.png); background-repeat:repeat-x">&nbsp;</td>
  </tr>
  <tr>
<td height="550" align="center" valign="top"><table width="980" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="80"><img src="../images/course-creation-header-2.png" width="980" height="50" alt="Create Course" /></td>
  </tr>
  <tr>
    <td height="30" align="right"><input type=button class="submit-course" onClick="location.href='class-create-content.php'" value='Done Adding Content' tabindex="10" /></td>
  </tr>
</table>
  <table width="980" border="0" align="center" cellpadding="4" cellspacing="4">
    <tr>
      <td style="color:#999"><p>You can configure your topics order, edit, delete or add content to the module, you have 3 options to do this. Each content option is a topic on the module, add has many topics has you need. When finish adding content click on the button above to return to the administration page.</p></td>
    </tr>
    <tr>
      <td align="center"><div id="contentLeft">
        <ul>
          <?php
				if(isset($course_content) && $course_content != false){
				foreach($course_content as $row){
				?>
          <li id="recordsArray_<?php echo $row['id']; ?>"><a href="#"><?php echo $row['title']; ?></a></li>
          <?php 
				}
					}
			?>
          </ul>
        </div></td>
    </tr>
    <tr>
      <td><div id="accordion">
        <h3><a href="#">Power Point Presentation</a></h3>
        <div>
          <form action="class-create-review.php" method="post" enctype="multipart/form-data" name="powerpointform" id="powerpointform" onsubmit="return powerpointValidation();">
            <table width="900" border="0" align="center" cellpadding="4" cellspacing="4">
              <tr>
                <td height="50" colspan="2"><span style="font-size:14px; color:#999">You can add video content using Youtube, Vimeo or any other video site. You just need to provide the video URL below and the topic content title. Once you provide this two fields click &quot;Add Video Content&quot;
                    <input name="contenttype" type="hidden" id="contenttype" value="power_point" />
                    <input name="uid" type="hidden" id="uid" value="<?php echo $uid; ?>" />
                </span></td>
                </tr>
              <tr>
                <td width="180" align="right"><h2>Title <span style="color:#F00">*</span></h2></td>
                <td><input name="title" type="text" class="form-course" id="title" tabindex="1" /></td>
              </tr>
              <tr>
                <td align="right"><h2>Select Document <span style="color:#F00">*</span></h2></td>
                <td><input name="pp_presentation" type="file" class="form-course" id="pp_presentation" tabindex="2" style="width:700px" /></td>
              </tr>
              <tr>
                <td align="right"><h2>Description <span style="color:#F00">*</span></h2></td>
                <td><textarea name="document_description" id="document_description" cols="45" rows="5" tabindex="3" style="width:700px">Powerpoint description</textarea></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td style="color:#F00; font-family:Arial, Helvetica, sans-serif"><em>all the fields marked with * are required fields</em></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td><input name="send" type="submit" class="submit" id="send" tabindex="4" value="Add  Video Content" /></td>
              </tr>
            </table>
          </form>
          </div>
        <h3><a href="#">Add Video Content</a></h3>
        <div>
          <form id="videocontent" name="videocontent" method="post" action="class-create-review.php" onsubmit="return videocontentValidation();">
            <table width="900" border="0" align="center" cellpadding="4" cellspacing="4">
              <tr>
                <td height="50" colspan="2"><span style="font-size:14px; color:#999">You can add video content using Youtube, Vimeo or any other video site. You just need to provide the video URL below and the topic content title. Once you provide this two fields click &quot;Add Video Content&quot;
                    <input name="contenttype" type="hidden" id="contenttype" value="video" />
                    <input name="uid" type="hidden" id="uid" value="<?php echo $uid; ?>" />
                </span></td>
                </tr>
              <tr>
                <td width="180" align="right"><h2>Title <span style="color:#F00">*</span></h2></td>
                <td><input name="title" type="text" class="form-course" id="title" tabindex="5" /></td>
              </tr>
              <tr>
                <td align="right"><h2>Video URL <span style="color:#F00">*</span></h2></td>
                <td><input name="video_url" type="text" class="form-course" id="video_url" tabindex="6" /></td>
              </tr>
              <tr>
                <td align="right"><h2>Video Description <span style="color:#F00">*</span></h2></td>
                <td><input name="video_description" type="text" class="form-course" id="video_description" tabindex="7" /></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td style="color:#F00; font-family:Arial, Helvetica, sans-serif"><em>all the fields marked with * are required fields</em></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td><input name="send4" type="submit" class="submit" id="send4" tabindex="8" value="Add  Video Content" /></td>
              </tr>
            </table>
          </form>
          </div>
        <h3><a href="#">Add Rich Text Content</a></h3>
        <div>
          <form id="richtextcontent" name="richtextcontent" method="post" action="class-create-review.php" onsubmit="return richtextValidation();">
            <script type="text/javascript">
            bkLib.onDomLoaded(function() { nicEditors.allTextAreas() });
        </script>
            <table width="900" border="0" align="center" cellpadding="4" cellspacing="4">
              <tr>
                <td colspan="2" style="font-size:14px; color:#999">If you already have your course in Microsoft Office Word document format, just copy and paste your content in this box and then made any other modification if needed. You can add pictures and format your text.
                  <input name="contenttype" type="hidden" id="contenttype" value="rich-text" />
                  <input name="uid" type="hidden" id="uid" value="<?php echo $uid; ?>" /></td>
                </tr>
              <tr>
                <td align="right" width="180" style="font-size:14px;"><h2>Title <span style="color:#F00">*</span></h2></td>
                <td style="font-size:14px; color:#999"><input name="title" type="text" class="form-course" id="title" tabindex="9" /></td>
              </tr>
              <tr>
                <td align="right" width="180" style="font-size:14px;"><h2>Description <span style="color:#F00">*</span></h2></td>
                <td style="font-size:14px; color:#999"><textarea name="body_content" class="form-course" id="body_content" tabindex="10" style="width: 700px; height: 120px;">This is my course placeholder</textarea></td>
              </tr>
              <tr>
                <td height="30">&nbsp;</td>
                <td height="30" style="color:#F00; font-family:Arial, Helvetica, sans-serif"><em>all the fields marked with * are required fields</em></td>
              </tr>
              <tr>
                <td height="50" colspan="2" align="center"><input name="send2" type="submit" class="submit-center" id="send2" tabindex="11" value="Create Rich Text Content" /></td>
                </tr>
              </table>
            </form>
          </div>
        <h3><a href="#">Create a Homework</a></h3>
        <div>
          <form id="homeworkmodule" name="homeworkmodule" method="post" action="class-create-review.php" onsubmit="return homeworkmoduleValidation();">
            <table width="900" border="0" align="center" cellpadding="4" cellspacing="4">
              <tr>
                <td colspan="2" style="font-size:14px; color:#999">To create a homework please provide the next fields below. On the description field you can include pictures, text, url or any other information may help the student. The deliver date is optional
                  <input name="contenttype" type="hidden" id="contenttype" value="homework" />
                  <input name="uid" type="hidden" id="uid" value="<?php echo $uid; ?>" /></td>
                </tr>
              <tr>
                <td width="130" align="right"><h2>Homework Title <span style="color:#F00">*</span></h2></td>
                <td width="700"><input name="title" type="text" class="form-course" id="title" tabindex="12" /></td>
              </tr>
              <tr>
                <td align="right"><h2>Description <span style="color:#F00">*</span></h2></td>
                <td><textarea name="homework_content" class="form-course" id="homework_content" style="width: 700px; height: 120px;" tabindex="13">This is the homework placeholder</textarea></td>
              </tr>
              <tr>
                <td align="right"><h2>Deliver Date <span style="color:#F00">*</span></h2></td>
                <td><input name="end_date" type="text" class="form-course" id="end_date" tabindex="14" />  <a href="javascript:show_calendar('document.homeworkmodule.end_date', document.homeworkmodule.end_date.value);"> <img src="/images/cal.gif" width="16" height="16" border="0" alt="Click Here to Pick up the timestamp" /></a></td>
              </tr>
              <tr>
                <td align="right"><h2>Deliver Method <span style="color:#F00">*</span></h2></td>
                <td><select name="deliver_method" class="form-course" id="deliver_method" tabindex="15">
                  <option value="email" selected="selected">The homework will be delivered via email ( to my email address )</option>
                  <option value="document">The homework will be delivered on a document via pie.edu (show upload form on the site)</option>
                  <option value="custom">The homework will be created on pie.edu ( show text form on the site )</option>
                  </select></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td style="color:#F00; font-family:Arial, Helvetica, sans-serif"><em>all the fields marked with * are required fields</em></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td><input name="Send" type="submit" class="submit" id="Send" value="Create Homework" tabindex="16" /></td>
              </tr>
            </table>
          </form>
          </div>
        <h3><a href="#">Create an Exam</a></h3>
        <div>
        <form id="setupexam" name="setupexam" method="post" action="class-create-review.php" onsubmit="return setupexamValidation();">
          <table width="900" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td height="50" style="color:#999; font-size:14px">To setup a new test please provide the information below. You will be asked to provide questions/answer for the exam or to choose them from our knowledge database
                <input name="contenttype" type="hidden" id="contenttype" value="exam" />
                <input name="uid" type="hidden" id="uid" value="<?php echo $uid; ?>" /></td>
              </tr>
            <tr>
              <td><table width="100%" border="0" align="center" cellpadding="4" cellspacing="4">
                <tr>
                  <td align="right" style="font-size:14px; font-family:Arial, Helvetica, sans-serif"><strong>Exam Title <span style="color:#F00">*</span></strong></td>
                  <td colspan="3"><input name="title2" type="text" class="form-course" id="title2" tabindex="17" /></td>
                </tr>
                <tr>
                  <td align="right" style="font-size:14px; font-family:Arial, Helvetica, sans-serif"><strong>Create Exam For <span style="color:#F00">*</span></strong></td>
                  <td colspan="3"><select name="uid2" class="form-course" id="uid2" tabindex="2">
                    <option value="0" selected="selected">Please Select a Module</option>
                    <?php
				  	echo $options;
                  ?>
                  </select></td>
                </tr>
                <tr>
                  <td width="130" align="right" style="font-size:14px; font-family:Arial, Helvetica, sans-serif"><strong>Questions Setup <span style="color:#F00">*</span></strong></td>
                  <td><select name="questions_type" class="form-course-small" id="questions_type" tabindex="18">
                    <option value="0" selected="selected">Questions Type</option>
                    <option value="optional">Optional Choice</option>
                    <option value="open">Open Answer</option>
                    <option value="multiple">Multiple Choice</option>
                    <option value="matching">Match Question/Answer</option>
                    <option value="essays">Essays</option>
                    <option value="problem">Solve Problems Question</option>
                    <option value="truefalse">True / False</option>
                  </select></td>
                  <td><select name="questions_quantity" class="form-course-small" id="questions_quantity" tabindex="20">
                    <option value="0" selected="selected">Questions Quantity</option>
                    <option value="1">1</option>
                    <option value="2">2</option>
                    <option value="3">3</option>
                    <option value="4">4</option>
                    <option value="5">5</option>
                    <option value="6">6</option>
                    <option value="7">7</option>
                    <option value="8">8</option>
                    <option value="9">9</option>
                    <option value="10">10</option>
                    <option value="11">11</option>
                    <option value="12">12</option>
                    <option value="13">13</option>
                    <option value="14">14</option>
                    <option value="15">15</option>
                    <option value="16">16</option>
                    <option value="17">17</option>
                    <option value="18">18</option>
                    <option value="19">19</option>
                    <option value="20">20</option>
                    <option value="25">25</option>
                    <option value="30">30</option>
                    <option value="35">35</option>
                    <option value="40">40</option>
                    <option value="45">45</option>
                    <option value="50">50</option>
                    <option value="55">55</option>
                    <option value="60">60</option>
                    <option value="65">65</option>
                    <option value="70">70</option>
                    <option value="75">75</option>
                    <option value="80">80</option>
                    <option value="85">85</option>
                    <option value="90">90</option>
                    <option value="95">95</option>
                    <option value="100">100</option>
                  </select></td>
                  <td width="130" align="center" style="font-family:Arial, Helvetica, sans-serif; font-size:10px"><a href="#" onclick="javascript:add_questions();">Add This Configuration</a></td>
                </tr>
                <tr>
                  <td align="right" style="font-size:14px; font-family:Arial, Helvetica, sans-serif">&nbsp;</td>
                  <td colspan="3" style="font-family:Arial, Helvetica, sans-serif; font-size:10px; color:#999"><input name="question_type" type="hidden" id="question_type" value="0" />
                    <input name="question_quantity" type="hidden" id="question_quantity" value="0" />
                    <span id="questions_status">Select your question type and question quantity from the dropdowns above and then click &quot;Add this configuration&quot; link to apply that settings. The selected settings will appear in this part, you can add up to 7 different questions type.</span></td>
                </tr>
                <tr>
                  <td align="right" style="font-size:14px; font-family:Arial, Helvetica, sans-serif"><strong>Question Source <span style="color:#F00">*</span></strong></td>
                  <td colspan="3"><select name="question_source" class="form-course" id="question_source">
                    <option value="private" selected="selected">Use My Own Questions</option>
                    <option value="public">Use Public Questions</option>
                  </select></td>
                </tr>
                <tr>
                  <td align="right" style="font-size:14px; font-family:Arial, Helvetica, sans-serif"><strong>Display Type <span style="color:#F00">*</span></strong></td>
                  <td colspan="3"><select name="question_display2" class="form-course" id="question_display2" tabindex="19">
                    <option value="1">One Question at a Time</option>
                    <option value="5">5 Questions at a Time</option>
                    <option value="10">10 questions at a Time</option>
                    <option value="20">20 Questions at a Time</option>
                    <option value="0" selected="selected">All the questions at the Same Time</option>
                  </select></td>
                </tr>
                <tr>
                  <td align="right" style="font-size:14px; font-family:Arial, Helvetica, sans-serif"><strong>Automatic Score <span style="color:#F00">*</span></strong></td>
                  <td colspan="3"><select name="automatic_score" class="form-course" id="automatic_score" tabindex="21">
                    <option value="Yes" selected="selected">Yes</option>
                    <option value="No">No</option>
                  </select></td>
                </tr>
                <tr>
                  <td align="right" style="font-size:14px; font-family:Arial, Helvetica, sans-serif"><strong>Set Timer <span style="color:#F00">*</span></strong></td>
                  <td colspan="3"><select name="question_timer" class="form-course" id="question_timer" tabindex="22">
                    <option value="0" selected="selected">No Timer</option>
                    <option value="5">5 Seconds Per Question</option>
                    <option value="10">10 Seconds Per Question</option>
                    <option value="15">15 Seconds Per Question</option>
                    <option value="20">20 Seconds Per Question</option>
                    <option value="25">25 Seconds Per Question</option>
                    <option value="30">30 Seconds Per Question</option>
                    <option value="60">1 Minute Per Question</option>
                    <option value="120">2 Minutes Per Question</option>
                    <option value="180">3 minutes Per Question</option>
                    <option value="300">5 Minutes Per Question</option>
                    <option value="600">10 Minutes Per Question</option>
                    <option value="900">15 Minutes Per Question</option>
                    <option value="1200">20 Minutes Per Question</option>
                  </select></td>
                </tr>
                <tr>
                  <td align="right" style="font-size:14px; font-family:Arial, Helvetica, sans-serif"><strong>Start Date</strong></td>
                  <td colspan="3"><input name="start_date" type="text" class="form-course" id="start_date" tabindex="23" />
                    <a href="javascript:show_calendar('document.setupexam.start_date', document.setupexam.start_date.value);"> <img src="/images/cal.gif" width="16" height="16" border="0" alt="Click Here to Pick up the timestamp" /></a></td>
                </tr>
                <tr>
                  <td align="right" style="font-size:14px; font-family:Arial, Helvetica, sans-serif"><strong>End Date</strong></td>
                  <td colspan="3"><input name="end_date2" type="text" class="form-course" id="end_date2" tabindex="24" />
                    <a href="javascript:show_calendar('document.setupexam.end_date', document.setupexam.end_date.value);"> <img src="/images/cal.gif" width="16" height="16" border="0" alt="Click Here to Pick up the timestamp" /></a></td>
                </tr>
                <tr>
                  <td align="right" style="font-size:14px; font-family:Arial, Helvetica, sans-serif"><strong>Show Calculator</strong></td>
                  <td colspan="3"><select name="calculator" class="form-course" id="calculator" tabindex="17">
                    <option value="Yes">Yes</option>
                    <option value="No" selected="selected">No</option>
                  </select></td>
                </tr>
                <tr>
                  <td align="right" style="font-size:14px; font-family:Arial, Helvetica, sans-serif">&nbsp;</td>
                  <td colspan="3" style="color:#F00; font-family:Arial, Helvetica, sans-serif"><em>all the fields marked with * are required fields</em></td>
                </tr>
                <tr>
                  <td colspan="4" align="center"><input name="send13" type="submit" class="submit-center" id="send13" value="Create The Test" tabindex="25" /></td>
                </tr>
              </table></td>
              </tr>
            </table>
            </form>
          </div>
        </div></td>
    </tr>
    <tr>
      <td height="50" align="center"><img src="../images/sb.png" width="959" height="11" /></td>
    </tr>
    </table>
  <table width="980" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td height="50" align="right" valign="top"><input type=button class="submit-course" onClick="location.href='class-create-content.php'" value='Done Adding Content' tabindex="10" /></td>
    </tr>
  </table></td>
      </tr>
  <tr>
    <td height="30" align="center" style=" background-image:url(../images/bottom-bg-student.png); background-repeat:repeat-x;">&nbsp;</td>
  </tr>
  <tr>
    <td height="50" align="center" bgcolor="#000000" style="color:#fff; font-family:Arial, Helvetica, sans-serif">PIE.EDU All Rights Reserved 2012<br />
      <a href="/common/privacy.php" class="bottom-menu" style="color:#999">Privacy Policy</a> | <a href="/common/terms.php" class="bottom-menu"  style="color:#999">Terms of Use</a> | <a href="/help/main.php" class="bottom-menu" style="color:#999">Help Center</a> | <a href="/common/jobs.php" class="bottom-menu" style="color:#999">Jobs</a></td>
  </tr>
    </table>
</body>
</html>